
//全屏滚动
$(document).ready(function () {
    $('#wrapper').fullpage(
    {
        sectionsColor: ['#214d6f','#214d6f','#336666'],
            navigation:true
        }
    );

    //绑定按钮
    $('#btn_login').bind('click',btnLoginClick);
});

//显示modal
function btnLoginClick() {
    $.ajax({
        url:'../data/user.json',
        method:'get',
        dataType:'json',
        success:function (data) {
            var username = $('#txtUsername').val();
            var password = $('#txtPassword').val();
            // alert(username)
            // alert(password)
            if(username == data.username && password == data.password){
                $('#modal_suc').modal();
                $('#modal_suc').on('hide.bs.modal',function () {
                    window.location.href="https://www.baidu.com";
                });
            } else{
                $('#modal_fal').modal();
            }
        }
    })
}